package com.xyq.system.manager;

import com.xyq.common.core.constants.CacheConstants;
import com.xyq.common.core.enums.ResultCode;
import com.xyq.common.redis.service.RedisService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class QuestionCacheManager {
    @Autowired
    private RedisService redisService ;

    // 把题目添加到缓存里
    public void addCache(Long questionId){
        // 头插
        redisService.leftPushForList(CacheConstants.QUESTION_LIST, questionId);
    }
    public void removeCache(Long questionId){
        //删除
        redisService.removeForList(CacheConstants.QUESTION_LIST , questionId);
    }
}
